package seata.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import seata.dao.SeataTableOneMapper;
import seata.entity.SeataTableOne;
import seata.feign.SeataTableThreeClient;
import seata.feign.SeataTableTwoClient;
import seata.service.SeataTableOneService;

@Service("SeataTableOneService")
public class SeataTableOneServiceImpl extends ServiceImpl<SeataTableOneMapper, SeataTableOne> implements SeataTableOneService {
    @Autowired
    private SeataTableTwoClient seataTableTwoClient;

    @Autowired
    private SeataTableThreeClient seataTableThreeClient;

    @Override
    public void updateSeataTableOneToThree(String name1, String name2, String name3){
        SeataTableOne seataTableOne = new SeataTableOne();
        seataTableOne.setId(1);
        seataTableOne.setName(name1);
        this.updateById(seataTableOne);
        seataTableTwoClient.update(name2);
        seataTableThreeClient.update(name3);
    }
}
